/*
 * Clock.cpp
 *
 *  Created on: 2012-5-18
 *      Author: WuyaMony
 */

#include "Clock.h"

namespace my {
int Clock::_timeCost=0;
Clock::Clock(deque<int> &Data, ArithmeticUnit &arithunit) :
		_data(Data), _arithunit(arithunit) {
}

void Clock::Tick() {
	_timeCost++;
	cout<<"tick: "<<_timeCost<<endl;
	if (_data.size() < 2) {
		return ;
	}
	int a=_data.front();_data.pop_front();
	int b=_data.front();_data.pop_front();
	_arithunit.addTask(a, b);
}

} /* namespace my */
